<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>GUI Control Types</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1><a href="Gui.htm">GUI</a> Control Types</h1>

<h2>Table of Contents</h2>
<ul>
  <li><a href="#Text">Text</a>, <a href="#Edit">Edit</a>, <a href="#UpDown">UpDown</a>, <a href="#Picture">Picture</a></li>
  <li><a href="#Button">Button</a>, <a href="#Checkbox">Checkbox</a>, <a href="#Radio">Radio</a></li>
  <li><a href="#DropDownList">DropDownList</a>, <a href="#ComboBox">ComboBox</a></li>
  <li><a href="#ListBox">ListBox</a>, <a href="ListView.htm">ListView</a>, <a href="TreeView.htm">TreeView</a></li>
  <li><a href="#Link">Link</a>, <a href="#Hotkey">Hotkey</a>, <a href="#DateTime">DateTime</a></li>
  <li><a href="#MonthCal">MonthCal</a>, <a href="#Slider">Slider</a>, <a href="#Progress">Progress</a></li>
  <li><a href="#GroupBox">GroupBox</a>, <a href="#Tab">Tab2</a>, <a href="#StatusBar">StatusBar</a></li>
  <li><a href="#ActiveX">ActiveX</a> (e.g. Internet Explorer Control)</li>
  <li><a href="#Custom">Custom</a></li>
</ul>

<h2 id="Text">Text</h2>
<p>Description: A region containing borderless text that the user cannot edit. Often used to label other controls. Example:</p>
<pre>Gui, Add, Text,, Please enter your name:</pre>
<p>In this case, the last parameter is the string to display. It may contain linefeeds (`n) to start new lines. In addition, a single long line can be broken up into several shorter ones by means of a <a href="../Scripts.htm#continuation">continuation section</a>.</p>
<p>If a width (W) is specified in <em>Options</em> but no <a href="Gui.htm#R">rows (R)</a> or height (H), the text will be word-wrapped as needed, and the control's height will be set automatically.</p>
<p>Since the control's contents are in the last parameter of the Gui command, literal commas do not need to be escaped. This is also true for the last parameter of all other commands.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user clicks the text. This can be used to simulate an underlined, blue hyperlink as shown in the following working script:</p>
<pre>Gui, Font, underline
Gui, Add, Text, cBlue gLaunchGoogle, Click here to launch Google.

<em>; Alternatively, Link controls can be used:</em>
Gui, Add, Link,, Click &lt;a href="www.google.com"&gt;here&lt;/a&gt; to launch Google.
Gui, Font, norm
Gui, Show
return

LaunchGoogle:
Run www.google.com
return</pre>
<p>A double-click can be detected by checking whether <a href="../Variables.htm#GuiEvent">A_GuiEvent</a> contains the word DoubleClick.</p>
<p>An ampersand (&amp;) may be used in the text to underline one of its letters. For example:</p>
<pre>Gui, Add, Text,, &amp;First Name:
Gui, Add, Edit</pre>
<p>In the example above, the letter F will be underlined, which allows the user to press the <a href="Gui.htm#ShortcutKey">shortcut key</a> Alt+F to set keyboard focus to the first input-capable control that was added after the text control. To instead display a literal ampersand, specify two consecutive ampersands (&amp;&amp;). To disable all special treatment of ampersands, include <a href="../misc/Styles.htm#SS_NOPREFIX">0x80</a> in the control's options.</p>
<p>See <a href="Gui.htm#OtherOptions">general options</a> for other options like <em>Right</em>, <em>Center</em>, and <em>Hidden</em>. See also: <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<h2 id="Edit">Edit</h2>
<p>Description: An area where free-form text can be typed by the user. Example:</p>
<pre>Gui, Add, Edit, r9 vMyEdit, Text to appear inside the edit control (omit this parameter to start off empty).</pre>
<p>The control will be multi-line if it has more than one row of text. For example, specifying <code>r3</code> in <em>Options</em> will create a 3-line edit control with the following default properties: a vertical scroll bar, word-wrapping enabled, and the Enter key captured as part of the input rather than triggering the window's <a href="#DefaultButton">default button</a>.</p>
<p>To start a new line in a multi-line edit control, the last parameter (contents) may contain either a solitary linefeed (`n) or a carriage return and linefeed (`r`n). Both methods produce literal `r`n pairs inside the Edit control. However, when the control is saved to its variable via <a href="Gui.htm#Submit">Gui Submit</a> or <a href="GuiControlGet.htm">GuiControlGet</a>, each `r`n in the text is always translated to a plain linefeed (`n). To write the text to a file, follow this example: <code><a href="FileAppend.htm">FileAppend</a>, %MyEdit%, C:\Saved File.txt</code>.</p>
<p>If the control has word-wrapping enabled (which is the default for multi-line edit controls), any wrapping that occurs as the user types will not produce linefeed characters (only the Enter keystroke can do that).</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user or the script changes the contents of the control.</p>
<p>TIP: To load a text file into an Edit control, use <a href="FileRead.htm">FileRead</a> and <a href="GuiControl.htm">GuiControl</a>. For example:</p>
<pre>Gui, Add, Edit, R20 vMyEdit
FileRead, FileContents, C:\My File.txt
GuiControl,, MyEdit, %FileContents%</pre>
<h3>Edit Options</h3>
<p>To remove an option rather than adding it, precede it with a minus sign:</p>
<p><strong>Limit</strong>: Restricts the user's input to the visible width of the edit field. Alternatively, to limit input to a specific number of characters, include a number immediately afterward. For example, <code>Limit10</code> would allow no more than 10 characters to be entered.</p>
<p><strong>Lowercase</strong>: The characters typed by the user are automatically converted to lowercase.</p>
<p><strong><a name="EditMulti" id="EditMulti"></a>Multi</strong>: Makes it possible to have more than one line of text. However, it is usually not necessary to specify this because it will be auto-detected based on height (H), <a href="Gui.htm#R">rows (R)</a>, or contents (<em>Text</em>).</p>
<p><strong><a name="EditNum"></a>Number</strong>: Prevents the user from typing anything other than digits into the field (however, it is still possible to paste non-digits into it). An alternate way of forcing a numeric entry is to attach an <a href="#UpDown">UpDown</a> control to the Edit.</p>
<p><strong>Password</strong>: Hides the user's input (such as for password entry) by substituting masking characters for what the user types. If a non-default masking character is desired, include it immediately after the word Password. For example, <code>Password*</code> would make the masking character an asterisk rather than the black circle (bullet), which is the default on Windows XP. Note: This option has no effect for multi-line edit controls.</p>
<p><strong>ReadOnly</strong>: Prevents the user from changing the control's contents. However, the text can still be scrolled, selected and copied to the clipboard.</p>
<p><strong>Tn</strong>: The letter T may be used to set tab stops inside a <a href="#EditMulti">multi-line edit control</a> (since tab stops determine the column positions to which literal TAB characters will jump, they can be used to format the text into columns). If the letter T is not used, tab stops are set at every 32 dialog units (the width of each &quot;dialog unit&quot; is determined by the operating system). If the letter T is used only once, tab stops are set at every <strong>n</strong> units across the entire width of the control. For example, <code>Gui, Add, Edit, vMyEdit r16 t64</code> would double the default distance between tab stops. To have custom tab stops, specify the letter T multiple times as in the following example: <code>Gui, Add, Edit, vMyEdit r16 t8 t16 t32 t64 t128</code>. One tab stop is set for each of the absolute column positions in the list, up to a maximum of 50 tab stops. Note: Tab stops require a multiline edit control.</p>
<p><strong>Uppercase</strong>: The characters typed by the user are automatically converted to uppercase.</p>
<p><strong>WantCtrlA</strong> <span class="ver">[v1.0.44+]:</span> Specify -WantCtrlA (minus WantCtrlA) to prevent the user's press of Control-A from selecting all text in the edit control.</p>
<p><strong><a name="WantReturn"></a>WantReturn</strong>: Specify -WantReturn (that is, a minus sign followed by WantReturn) to prevent a multi-line edit control from capturing the Enter keystroke. Pressing Enter will then be the same as pressing the window's <a href="#DefaultButton">default button</a> (if any). In this case, the user may press Control-Enter to start a new line.</p>
<p><strong>WantTab</strong>: Causes a tab keystroke to produce a tab character rather than navigating to the next control. Without this option, the user may press Control-Tab to produce a tab character inside a multi-line edit control. Note: Although <em>WantTab</em> also works in a single-line edit control, each tab character is displayed as an empty-box character (though it is stored as a real tab).</p>
<p><strong>-Wrap</strong> (minus wrap): Turns off word-wrapping in a multi-line edit control. Since this style cannot be changed after the control has been created, use one of the following to change it: 1) <a href="Gui.htm#Destroy">Destroy</a> then recreate the window and its control; or 2) Create two overlapping edit controls, one with wrapping enabled and the other without it. The one not currently in use can be kept empty and/or hidden.</p>
<p>See <a href="Gui.htm#OtherOptions">general options</a> for other options like <em>Right</em>, <em>Center</em>, and <em>Hidden</em>. See also: <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<p><strong>A more powerful edit control</strong>: HiEdit is a free, multitabbed, large-file edit control consuming very little memory. It can edit both text and binary files. For details and a demonstration, see <a href="http://www.autohotkey.com/forum/topic19141.html">www.autohotkey.com/forum/topic19141.html</a></p>
<h2 id="UpDown">UpDown</h2>
<p>Description: A pair of arrow buttons that the user can click to increase or decrease a value. By default, an UpDown control automatically snaps onto the previously added control. This previous control is known as the UpDown's <em>buddy control</em>. The most common example is a &quot;spinner&quot;, which is an UpDown attached to an <a href="#Edit">Edit control</a>. For example:</p>
<pre>Gui, Add, Edit
Gui, Add, UpDown, vMyUpDown Range1-10, 5</pre>
<p>In the example above, the Edit control is the UpDown's buddy control. Whenever the user presses one of the arrow buttons, the number in the Edit control is automatically increased or decreased.</p>
<p>An UpDown's buddy control can also be a <a href="#Text">Text control</a> or <a href="#ListBox">ListBox</a>. However, due to OS limitations, controls other than these (such as ComboBox and DropDownList) might not work properly with <a href="Gui.htm#label">g-labels</a> and other features.</p>
<p>Specify the UpDown's starting position as the last parameter (if omitted, it starts off at 0 or the number in the allowable range that is closest to 0).</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the current numeric position of the UpDown. If the UpDown is attached to an Edit control and you do not wish to validate the user's input, it is best to use the UpDown's value rather than the Edit's. This is because the UpDown will always yield an in-range number, even when the user has typed something non-numeric or out-of-range in the Edit control. On a related note, numbers with more than three digits get a <a href="../misc/Styles.htm#UpDownSep">thousands separator</a> (such as comma) by default. These separators are stored in the Edit's output variable but not that of the UpDown.</p>
<p>If the UpDown has a <a href="Gui.htm#label">g-label</a>, it will be launched whenever the user clicks one of the arrow buttons or presses an arrow key on the keyboard. Each launch of the g-label also stores the UpDown's position in its <a href="Gui.htm#var">associated output variable</a> (if any).</p>
<h3>UpDown Options</h3>
<p><strong><a name="Horz"></a>Horz</strong>: Make's the control's buttons point left/right rather than up/down. By default, <em>Horz</em> also makes the control isolated (no buddy). This can be overridden by specifying <code>Horz 16</code> in the control's options.</p>
<p><strong>Left</strong>: Puts the UpDown on the left side of its buddy rather than the right.</p>
<p><strong>Range</strong>: Sets the range to be something other than 0 to 100. After the word Range, specify the minimum, a dash, and maximum. For example, Range1-1000 would allow a number between 1 and 1000 to be selected; Range-50-50 would allow a number between -50 and 50; and Range-10--5 would allow a number between -10 and -5. The minimum and maximum may be swapped to cause the arrows to move in the opposite of their normal direction. The broadest allowable range is -2147483648-2147483647. Finally, if the buddy control is a <a href="#ListBox">ListBox</a>, the range defaults to 32767-0 for verticals and the inverse for horizontals (<a href="#Horz">Horz</a>).</p>
<p><strong>Wrap</strong>: Causes the control to wrap around to the other end of its range when the user attempts to go beyond the minimum or maximum. Without <em>Wrap</em>, the control stops when the minimum or maximum is reached.</p>
<p><strong>-16</strong> (minus 16): Causes a vertical UpDown to be isolated; that is, it will have no buddy. This also causes the control to obey any specified width, height, and position rather than conforming to the size of its buddy control. In addition, an isolated UpDown tracks its own position internally. This position can be retrieved normally by means such as <a href="Gui.htm#Submit">Gui Submit</a>.</p>
<p><strong><a name="UpDownSep"></a>0x80</strong>: Include <code>0x80</code> in <em>Options</em> to omit the thousands separator that is normally present between every three decimal digits in the buddy control. However, this style is normally not used because the separators are omitted from the number whenever the script retrieves it from the UpDown control itself (rather than its buddy control).</p>
<p><strong>Increments other than 1</strong>: In <a href="http://numeric.nerim.net/AutoHotkey/Scripts/UpDown%20-%20Non-unitary%20increments.ahk">this script</a>, NumEric demonstrates how to change an UpDown's increment to a value other than 1 (such as 5 or 0.1).</p>
<p>See also: <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<h2 id="Picture">Picture (or Pic)</h2>
<p>Description: An area containing an image (see last two paragraphs for supported file types). The last parameter is the filename of the image, which is assumed to be in <a href="../Variables.htm#WorkingDir">A_WorkingDir</a> if an absolute path isn't specified. Example:</p>
<pre>Gui, Add, Picture, w300 h-1, C:\My Pictures\Company Logo.gif</pre>
<p>To retain the image's actual width and/or height, omit the W and/or H options. Otherwise, the image is scaled to the specified width and/or height (this width and height also determines which icon to load from a multi-icon .ICO file). To shrink or enlarge the image while preserving its aspect ratio, specify -1 for one of the dimensions and a positive number for the other. For example, specifying <code>w200 h-1</code> would make the image 200 pixels wide and cause its height to be set automatically. If the picture cannot be loaded or displayed (e.g. file not found), the control is left empty and its width and height are set to zero.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user clicks the picture. A double-click can be detected by checking whether <a href="../Variables.htm#GuiEvent">A_GuiEvent</a> contains the word DoubleClick.</p>
<p>To use a picture as a background for other controls, the picture should normally be added prior to those controls. However, if those controls are input-capable and the picture has a <a href="Gui.htm#label">g-label</a>, create the picture after the other controls and include <code>0x4000000</code> (which is WS_CLIPSIBLINGS) in the picture's <em>Options</em>. This trick also allows a picture to be the background behind a <a href="#Tab">Tab control</a> or <a href="ListView.htm">ListView</a>.</p>
<p><strong>Icons, cursors, and animated cursors</strong>: Icons and cursors may be loaded from the following types of files: ICO, CUR, ANI, EXE, DLL, CPL, SCR, and other types that contain icon resources. To use an icon group other than the first one in the file, include in <em>Options</em> the word Icon followed by the number of the group. In the following example, the default icon from the second icon group would be used: <code>Gui, Add, Picture, Icon2, C:\My Application.exe</code>.</p>
<p><a name="PicAltSubmit"></a>Specifying the word AltSubmit in <em>Options</em> tells the program to use Microsoft's GDIPlus.dll to load the image, which might result in a different appearance for GIF, BMP, and icon images. For example, it would load an ICO/GIF that has a transparent background as a transparent bitmap, which allows the <a href="Gui.htm#BackgroundTrans">BackgroundTrans</a> option to take effect. If GDIPlus is not available (see next paragraph), AltSubmit is ignored and the image is loaded using the normal method.</p>
<p>All operating systems support GIF, JPG,  BMP, ICO, CUR, and ANI images. On Windows XP or later, additional image formats such as PNG, TIF, Exif, WMF, and EMF are supported. Operating systems older than XP can be given support by copying Microsoft's free GDI+ DLL into the AutoHotkey.exe folder (but in the case of a <a href="../Scripts.htm#ahk2exe">compiled script</a>, copy the DLL into the script's folder). To download the DLL, search for the following phrase at <a href="http://www.microsoft.com">www.microsoft.com</a>: gdi redistributable</p>
<p><strong>Animated GIFs</strong>: Although animated GIF files can be displayed in a picture control, they will not actually be animated. To solve this, use the AniGIF DLL (which is free for non-commercial use) as demonstrated at <a href="http://www.autohotkey.com/forum/topic19264.html">www.autohotkey.com/forum/topic19264.html</a></p>
<h2 id="Button">Button</h2>
<p>Description: A pushbutton, which can be pressed to trigger an action.  In this case, the last parameter is the name of the button (shown on the button itself), which may include linefeeds (`n) to start new lines. Example:</p>
<pre>Gui, Add, Button, Default, OK</pre>
<p><a name="DefaultButton"></a>The example above includes the word <strong>Default</strong> in its <em>Options</em> to make &quot;OK&quot; the default button. The default button's action is automatically triggered whenever the user presses ENTER, except when the keyboard focus is on a different button or a multi-line edit control having the <a href="#WantReturn">WantReturn</a> style. To later change the default button to another button, follow this example, which makes the Cancel button become the default: <code><a href="GuiControl.htm">GuiControl</a>, +Default, Cancel</code>. To later change the window to have no default button, follow this example: <code>GuiControl, -default, OK</code>.</p>
<p>An ampersand (&amp;) may be used in the name button to underline one of its letters. For example:</p>
<pre>Gui, Add, Button,, &amp;Pause</pre>
<p>In the example above, the letter P will be underlined, which allows the user to press Alt+P as <a href="Gui.htm#ShortcutKey">shortcut key</a>. To display a literal ampersand, specify two consecutive ampersands (&amp;&amp;).</p>
<p>If a button lacks an explicit <a href="Gui.htm#label">g-label</a>, an automatic label is assumed. For example, if the first GUI window contains an OK button, the ButtonOK label (if it exists) will be launched when the button is pressed. For GUI windows <a href="Gui.htm#MultiWin">other than the first</a>, the window number is included in front of the button's automatic label; for example: <code>2ButtonOK</code>.</p>
<p>If the text on the button contains spaces or any of the characters in the set <strong>&amp;`r`n`t`</strong>, its automatic label omits those characters. For example, a button titled &quot;&amp;Pause&quot; would have an automatic label of ButtonPause. Similarly, a button titled &quot;Save &amp;&amp; Exit&quot; would have an automatic label of ButtonSaveExit (the double-ampersand is used to display a single, literal ampersand).</p>
<p>Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including <code>-Wrap</code> (minus Wrap) in the button's options. However, this also prevents having more than one line of text.</p>

<h2 id="Checkbox">Checkbox</h2>
<p>Description: A small box that can be checked or unchecked to represent On/Off, Yes/No, etc. Example:</p>
<pre>Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?</pre>
<p>The last parameter is a label displayed next to the box, which is typically used as a prompt or description of what the checkbox does. It may include linefeeds (`n) to start new lines. If a width (W) is specified in <em>Options</em> but no <a href="Gui.htm#R">rows (R)</a> or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically. The checkbox's <a href="Gui.htm#var">associated output variable</a> (if any) receives the number 1 for checked, 0 for unchecked, and -1 for gray/indeterminate.</p>
<p>Specify the word <strong>Check3</strong> in <em>Options</em> to enable a third state that displays a gray checkmark instead of a black one (the gray state indicates that the checkbox is neither checked nor unchecked). Specify the word <strong>Checked</strong> or <strong>CheckedGray</strong> in <em>Options</em> to have the checkbox start off with a black or gray checkmark, respectively. The word Checked may optionally be followed immediately by a 0, 1, or -1 to indicate the starting state. In other words, <code>Checked</code> and <code>Checked%VarContainingOne%</code> are the same.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user clicks or changes the checkbox.</p>
<p>Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including <code>-Wrap</code> (minus Wrap) in the button's options. However, this also prevents having more than one line of text.</p>
<h2 id="Radio">Radio</h2>
<p>A Radio button is a small empty circle that can be checked (on) or unchecked (off). Example:</p>
<pre>Gui, Add, Radio, vMyRadioGroup, Wait for all items to be in stock before shipping.</pre>
<p>These controls usually appear in <em>radio groups</em>, each of which contains two or more radio buttons. When the user clicks a radio button to turn it on, any others in its radio group are turned off automatically (the user may also navigate inside a group with the arrow keys). A radio group is created automatically around all consecutively added radio buttons. To start a new group, specify the word <strong>Group</strong> in the <em>Options</em> of the first button of the new group -- or simply add a non-radio control in between, since that automatically starts a new group.</p>
<p>For the last parameter, specify the label to display to the right of the radio button. This label is typically used as a prompt or description, and it may include linefeeds (`n) to start new lines. If a width (W) is specified in <em>Options</em> but no rows (R) or height (H), the control's text will be word-wrapped as needed, and the control's height will be set automatically.</p>
<p>Specify the word <strong>Checked</strong> in <em>Options</em> to have the button start off in the &quot;on&quot; state. The word Checked may optionally be followed immediately by a 0 or 1 to indicate the starting state: 0 for unchecked and 1 for checked. In other words, <code>Checked</code> and <code>Checked%VarContainingOne%</code> are the same.</p>
<p>The radio button's <a href="Gui.htm#var">associated output variable</a> (if any) receives the number 1 for &quot;on&quot; and 0 for &quot;off&quot;. However, if only one button in a radio group has a variable, that variable will instead receive the number of the currently selected button: 1 is the first radio button (according to original creation order), 2 is the second, and so on. If there is no button selected, 0 is stored.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user turns on the button. Unlike the single-variable mode in the previous paragraph, the g-label must be specified for each button in a radio group for which the label should be launched. This allows the flexibility to ignore the clicks of certain buttons. Finally, a double-click can be detected by checking whether <a href="../Variables.htm#GuiEvent">A_GuiEvent</a> contains the word DoubleClick.</p>
<p>Known limitation: Certain desktop themes might not display a button's text properly. If this occurs, try including <code>-Wrap</code> (minus Wrap) in the button's options. However, this also prevents having more than one line of text.</p>
<h2 id="DropDownList">DropDownList (or DDL)</h2>
<p>Description: A list of choices that is displayed in response to pressing a small button.  In this case, the last parameter is a pipe-delimited list of choices such as <code>Choice1|Choice2|Choice3</code>. Example:</p>
<pre>Gui, Add, DropDownList, vColorChoice, Black|White|Red|Green|Blue</pre>
<p>To have one of the items pre-selected when the window first appears, include two pipe characters after it (e.g. <code>Red|Green||Blue</code>). Alternatively, include in <em>Options</em> the word <strong>Choose</strong> followed immediately by the number to pre-select. For example, <code>Choose5</code> would pre-select the fifth item (as with other options, it can also be a variable such as <code>Choose%Var%</code>). To change the choice or add/remove entries from the list after the control has been created, use <a href="GuiControl.htm">GuiControl</a>.</p>
<p>Specify either the word <strong>Uppercase</strong> or <strong>Lowercase</strong> in <em>Options</em> to automatically convert all items in the list to uppercase or lowercase. Specify the word <strong>Sort</strong> to automatically sort the contents of the list alphabetically (this also affects any items  added later via <a href="GuiControl.htm">GuiControl</a>). The Sort option also enables incremental searching whenever the list is dropped down; this allows an item to be selected by typing the first few characters of its name.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the text of the currently selected item. However, if the control has the <a href="Gui.htm#AltSubmit">AltSubmit</a> property, the output variable will receive the item's position number instead (the first item is 1, the second is 2, etc.).</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user selects a new item.</p>
<p>Use the <a href="Gui.htm#R">R or H option</a> to control the height of the popup list. For example, specifying <code>R5</code> would make the list 5 rows tall, while <code>H400</code> would set the total height of the selection field and list to 400 pixels. If both R and H are omitted, the list will automatically expand to take advantage of the available height of the user's desktop (however, operating systems older than Windows XP will show 3 rows by default).</p>
<p id="ComboBoxHeight">To set the height of the selection field or list items, use the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb775911">CB_SETITEMHEIGHT</a> message as in the example below:</p>
<pre>Gui Add, DDL, vcbx w200 hwndhcbx, One||Two
<em>; CB_SETITEMHEIGHT = 0x153</em>
PostMessage, 0x153, -1, 50,, ahk_id %hcbx%  <em>; Set height of selection field.</em>
PostMessage, 0x153,  0, 50,, ahk_id %hcbx%  <em>; Set height of list items.</em>
Gui Show, h70, Test</pre>
<p>The separator between fields may be changed to something other than pipe (|). For example <code><a href="Gui.htm#Delimiter">Gui +Delimiter`n</a></code> would change it to linefeed and <code>Gui +DelimiterTab</code> would change it to tab (`t).</p>

<h2 id="ComboBox">ComboBox</h2>
<p>Description: Same as DropDownList but also permits free-form text to be entered as an alternative to picking an item from the list. Example:</p>
<pre>Gui, Add, ComboBox, vColorChoice, Red|Green|Blue|Black|White</pre>
<p>In addition to allowing all the same options as DropDownList above, the word <strong>Limit</strong> may be included in <em>Options</em> to restrict the user's input to the visible width of the ComboBox's edit field. Also, the word <strong>Simple</strong> may be specified to make the ComboBox behave as though it is an Edit field with a ListBox beneath it.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the text of the currently selected item. However, if the control has the <a href="Gui.htm#AltSubmit">AltSubmit</a> property, the output variable will receive the item's position number instead (the first item is 1, the second is 2, etc.). If either case, if there is no selected item, the output variable will be set to the contents of the ComboBox's edit field.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user selects a new item.</p>

<h2 id="ListBox">ListBox</h2>
<p>Description: A relatively tall box containing a list of choices that can be selected. In this case, the last parameter is a pipe-delimited list of choices such as <code>Choice1|Choice2|Choice3</code>. Example:</p>
<pre>Gui, Add, ListBox, vColorChoice, Red|Green|Blue|Black|White</pre>
<p><a name="ChooseLB"></a>To have list item(s) pre-selected when the window first appears, include two pipe characters after each (the <a href="#ListBoxMulti">Multi</a> option is required if more than one item is to be pre-selected). Alternatively, include in <em>Options</em> the word <strong>Choose</strong> followed immediately by a single item number to pre-select. For example, <code>Choose5</code> would pre-select the fifth item. To change the choice or add/remove entries from the list after the control has been created, use <a href="GuiControl.htm">GuiControl</a>.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the text of the currently selected item. However, if the control has the <a href="Gui.htm#AltSubmit">AltSubmit</a> property, the output variable instead receives the item's position number (the first item is 1, the second is 2, etc.).</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user selects a new item. If the user double-clicks an item, the built-in variable A_GuiEvent will contain the string DoubleClick rather than Normal. Also, the variable A_EventInfo will contain the position of the item that was double-clicked (1 is the first item, 2 is the second, etc.).</p>
<p><a name="LBRedraw"></a>When adding a large number of items to a ListBox, performance may be improved by using <code>GuiControl, -Redraw, MyListBox</code> prior to the operation, and <code>GuiControl, +Redraw, MyListBox</code> afterward.</p>
<h3>ListBox Options</h3>
<p><strong>Choose</strong>: See <a href="#ChooseLB">above</a>.</p>
<p><strong><a name="ListBoxMulti"></a>Multi</strong>: Allows more than one item to be selected simultaneously via shift-click and control-click (to avoid the need for shift/control-click, specify <a href="../misc/Styles.htm#LBS_MULTI">the number 8</a> instead of the word Multi). In this case, <a href="Gui.htm#Submit">Gui Submit</a> stores a pipe delimited list of item-strings in the control's <a href="Gui.htm#var">output variable</a>. However, if the <a href="Gui.htm#AltSubmit">AltSubmit</a> option is in effect, <a href="Gui.htm#Submit">Gui Submit</a> stores a pipe-delimited list of item numbers instead. For example, <code>1|2|3</code> would indicate that the first three items are selected. To extract the individual items from the string, use a <a href="LoopParse.htm">parsing loop</a> such as this example:</p>
<pre>Loop, parse, MyListBox, |
{
    MsgBox Selection number %A_Index% is %A_LoopField%.
}</pre>
<p>The separator between fields may be changed to something other than pipe (|). For example <code><a href="Gui.htm#Delimiter">Gui +Delimiter`n</a></code> would change it to linefeed and <code>Gui +DelimiterTab</code> would change it to tab (`t).</p>
<p><strong>ReadOnly</strong>: Prevents items from being visibly highlighted when they are selected (but <a href="Gui.htm#Submit">Gui Submit</a> will still store the selected item).</p>
<p><strong>Sort</strong>: Automatically sorts the contents of the list alphabetically (this also affects any items added later via <a href="GuiControl.htm">GuiControl</a>). The Sort option also enables incremental searching, which allows an item to be selected by typing the first few characters of its name.</p>
<p><strong>Tn</strong>: The letter T may be used to set tab stops, which can be used to format the text into columns. If the letter T is not used, tab stops are set at every 32 dialog units (the width of each &quot;dialog unit&quot; is determined by the operating system). If the letter T is used only once, tab stops are set at every <strong>n</strong> units across the entire width of the control. For example, <code>Gui, Add, ListBox, vMyListBox t64</code> would double the default distance between tab stops. To have custom tab stops, specify the letter T multiple times as in the following example: <code>Gui, Add, ListBox, vMyListBox t8 t16 t32 t64 t128</code>. One tab stop is set for each of the absolute column positions in the list, up to a maximum of 50 tab stops.</p>
<p><strong>0x100</strong>: Include 0x100 in options to turn on the LBS_NOINTEGRALHEIGHT style. This forces the ListBox to be exactly the height specified rather than a height that prevents a partial row from appearing at the bottom. This option also prevents the ListBox from shrinking when its font is changed.</p>
<p>To specify the number of rows of text (or the height and width), see <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<h2>ListView and TreeView</h2>
<p>See separate pages <a href="ListView.htm">ListView</a> and <a href="TreeView.htm">TreeView</a>.</p>

<h2 id="Link">Link <span class="ver">[v1.1.06+]</span></h2>
<p>Description: A text control that can contain links that can be clicked. Link controls use HTML-like markup language, but they only support the &lt;A&gt; tag. Inside the opening tag, an attribute of the form Attribute="value" may be specified. This is typically an ID or a HREF attribute, e.g.:</p>
<pre>Gui, Add, Link,, This is a &lt;a href="http://ahkscript.org"&gt;link&lt;/a&gt;
Gui, Add, Link,, Links may be used anywhere in the text like &lt;a id="1"&gt;this&lt;/a&gt; or &lt;a id="2"&gt;that&lt;/a&gt;</pre>
<p>Clicks on a link will be handled automatically if the HREF attribute is set and it is executable (like an URL or a command). If the HREF attribute is not used or it couldn't be executed a <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be launched if it was provided. The <a href="../misc/ErrorLevel.htm">ErrorLevel</a> variable then contains the value of the attribute so that the link that was clicked can be identified.</p>

<h2 id="Hotkey">Hotkey</h2>
<p>Description: A box that looks like a single-line edit control but instead accepts a keyboard combination pressed by the user. For example, if the user presses Control+Alt+C on an English keyboard layout, the box would display &quot;Ctrl + Alt + C&quot;.</p>
<pre>Gui, Add, Hotkey, vChosenHotkey</pre>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the hotkey modifiers and name, which are compatible with the <a href="Hotkey.htm">Hotkey</a> command. Examples: <code>^!C</code>, <code>+!Home</code>, <code>+^Down</code>, <code>^Numpad1</code>, <code>!NumpadEnd</code>. If there is no hotkey in the control, the output variable is made blank. Note: Some keys are displayed the same even though they are retrieved as different names. For example, both <code>^Numpad7</code> and <code>^NumpadHome</code> might be displayed as Ctrl + Num 7.</p>
<p>By default, the control starts off with no hotkey specified. To instead have a default, specify its modifiers and name as the last parameter as in this example: <code>Gui, Add, Hotkey, vChosenHotkey, ^!p</code><br>
The only modifiers supported are ^ (Control), ! (Alt), and + (Shift). See the <a href="../KeyList.htm">key list</a> for available key names.</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user changes the hotkey. Each launch of the g-label also stores the hotkey in control's <a href="Gui.htm#var">associated output variable</a> (if any). Note: the g-label is launched even when an incomplete hotkey is present. For example, if the user holds down the Control key, the g-label is launched once and the output variable contains only a circumflex (^). When the user completes the hotkey, the label is launched again and the variable contains the complete hotkey.</p>
<p>To restrict the types of hotkeys the user may enter, include the word <strong>Limit</strong> followed by the sum of one or more of the following numbers:</p>
<p>1: Prevent unmodified keys<br>
  2: Prevent Shift-only keys <br>
4: Prevent Control-only keys <br>
8: Prevent Alt-only keys<br>
16: Prevent Shift-Control keys <br>
32: Prevent Shift-Alt keys <br>
64: This value is not supported (it will not behave correctly).<br>
128: Prevent Shift-Control-Alt keys.</p>
<p>For example, <code>Limit1</code> would prevent unmodified hotkeys such as letters and numbers from being entered, and <code>Limit15</code> would require at least two modifier keys. If the user types a forbidden modifier combination, the Control+Alt combination is automatically and visibly substituted.</p>
<p>The Hotkey control has limited capabilities. For example, it does not support mouse/joystick hotkeys or the Windows key (LWin and RWin). One way to work around this is to provide one or more <a href="#Checkbox">checkboxes</a> as a means for the user to enable extra modifiers such as the Windows key.</p>

<h2 id="DateTime">DateTime</h2>
<p>Description: A box that looks like a single-line edit control but instead accepts a date and/or time. A drop-down calendar is also provided. Example:</p>
<pre>Gui, Add, DateTime, vMyDateTime, LongDate</pre>
<p><a name="DateTimeFormat"></a>The last parameter may be one of the following:</p>
<p><strong>(omitted)</strong>: When omitted, the locale's short date format is used. For example, in some locales it would look like: 6/1/2005</p>
<p><strong>LongDate</strong>: Uses the locale's long date format. For example, in some locales it would look like: Wednesday, June 01, 2005</p>
<p><strong>Time</strong>: Shows only the time using the locale's time format. Although the date is not shown, it is still present in the control and will be retrieved along with the time in the <a href="FileSetTime.htm#YYYYMMDD">YYYYMMDDHH24MISS</a> format.</p>
<p><strong>(custom format)</strong>: Specify any combination of <a href="FormatTime.htm">date and time formats</a>. For example, <code>M/d/yy HH:mm</code> would look like 6/1/05 21:37. Similarly, <code>dddd MMMM d, yyyy hh:mm:ss tt</code> would look like Wednesday June 1, 2005 09:37:45 PM. Letters and numbers to be displayed literally should be enclosed in single quotes as in this example: <code>'Date:' MM/dd/yy 'Time:' hh:mm:ss tt</code>. By contrast, non-alphanumeric characters such as spaces, tabs, slashes, colons, commas, and other punctuation do not need to be enclosed in single quotes. The exception to this is the single quote character itself: to produce it literally, use four consecutive single quotes (''''), or just two if the quote is already inside an outer pair of quotes.</p>
<h3>DateTime Usage</h3>
<p><a name="ChooseDT"></a>To have a date other than today pre-selected, include in <em>Options</em> the word <strong>Choose</strong> followed immediately by a date in YYYYMMDD format. For example, <code>Choose20050531</code> would pre-select May 31, 2005 (as with other options, it can also be a variable such as <code>Choose%Var%</code>). To have no date/time selected, specify <strong>ChooseNone</strong>. <em>ChooseNone</em> also creates a checkbox inside the control that is unchecked whenever the control has no date. Whenever the control has no date, <a href="Gui.htm#Submit">Gui Submit</a> and <a href="GuiControlGet.htm">GuiControlGet</a> will retrieve a blank value (empty string).</p>
<p>The time of day may optionally be present. However, it must always be preceded by a date when going into or coming out of the control. The format of the time portion is HH24MISS (hours, minutes, seconds), where HH24 is expressed in 24-hour format; for example, 09 is 9am and 21 is 9pm. Thus, a complete date-time string would have the format <a href="FileSetTime.htm#YYYYMMDD">YYYYMMDDHH24MISS</a>.</p>
<p>When specifying dates in the YYYYMMDDHH24MISS format, only the leading part needs to be present. Any remaining element that has been omitted will be supplied with the following default values:<br>
MM: Month 01<br>
DD: Day 01<br>
HH24: Hour 00<br>
MI: Minute 00<br>
SS: Second 00</p>
<p>Within the drop-down calendar, the today-string at the bottom can be clicked to select today's date. In addition, the year and month name are clickable and allow easy navigation to a new month or year.</p>
<p>Keyboard navigation: Use the Up/Down arrow keys, NumpadPlus/Minus, and Home/End to increase or decrease the control's values. Use LeftArrow and RightArrow to move from field to field inside the control. Within the drop-down calendar, use the arrow keys to move from day to day; use PageUp/Down to move backward/forward by one month; use Ctrl-PageUp/Down to move backward/forward by one year; and use Home/End to select the first/last day of the month.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the selected date and time in <a href="FileSetTime.htm#YYYYMMDD">YYYYMMDDHH24MISS</a> format. Both the date and the time are present regardless of whether they were actually visible in the control.</p>
<p>If the control has a <a href="Gui.htm#label">g-label</a>, the label is launched whenever the user changes the date or time. For each launch, the control's <a href="Gui.htm#var">associated output variable</a> (if any) is automatically updated with the currently selected date/time.</p>
<h3>DateTime Options</h3>
<p><strong>Choose</strong>: See <a href="#ChooseDT">above</a>.</p>
<p><strong>Range</strong>: Restricts how far back or forward in time the selected date can be. After the word Range, specify the minimum and maximum dates in YYYYMMDD format (with a dash between them). For example, <code>Range20050101-20050615</code> would restrict the date to the first 5.5 months of 2005. Either the minimum or maximum may be omitted to leave the control unrestricted in that direction. For example, <code>Range20010101</code> would prevent a date prior to 2001 from being selected and <code>Range-20091231</code> (leading dash) would prevent a date later than 2009 from being selected. Without the Range option, any date between the years 1601 and 9999 can be selected. The time of day cannot be restricted.</p>
<p><strong>Right</strong>: Causes the drop-down calendar to drop down on the right side of the control instead of the left.</p>
<p><strong>1</strong>: Specify the number 1 in <em>Options</em> to provide an up-down control to the right of the control to modify date-time values, which replaces the button of the drop-down month calendar that would otherwise be available. This does not work in conjunction with the format option LongDate described above.</p>
<p><strong><a name="ChooseNone"></a>2</strong>: Specify the number 2 in <em>Options</em> to provide a checkbox inside the control that the user may uncheck to indicate that no date/time is selected. Once the control is created, this option cannot be changed.</p>
<h2 id="MonthCal">MonthCal</h2>
<p>Description: A tall and wide control that displays all the days of the month in calendar format. The user may select a single date or a range of dates. Example:</p>
<pre>Gui, Add, MonthCal, vMyCalendar</pre>
<p>To have a date other than today pre-selected, specify it as the last parameter in YYYYMMDD format (e.g. <code>20050531</code>). A range of dates may also be pre-selected by including a dash between two dates (e.g. <code>20050525-20050531</code>).</p>
<p>It is usually best to omit width (W) and height (H) for a MonthCal because it automatically sizes itself to fit exactly one month. To display more than one month vertically, specify <code>R2</code> or higher in <em>Options</em>. To display more than one month horizontally, specify <code>W-2</code> (W negative two) or higher. These options may both be present to expand in both directions.</p>
<p>The today-string at the bottom of the control can be clicked to select today's date. In addition, the year and month name are clickable and allow easy selection of a new year or month.</p>
<p>Unlike <a href="#DateTime">DateTime</a>'s drop-down calendar, keyboard navigation is generally not supported in a MonthCal.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the selected date in YYYYMMDD format (without any time portion). However, when the <a href="#MonthCalMulti">multi-select</a> option is in effect, the minimum and maximum dates are retrieved with a dash between them (e.g. <code>20050101-20050108</code>). If only a single date was selected in a multi-select calendar, the minimum and maximum are both present but identical. <a href="StringSplit.htm">StringSplit</a> can be used to separate the dates. For example, the following would put the minimum in Date1 and the maximum in Date2: <code>StringSplit, Date, MyMonthCal, -</code>.</p>
<p>If the MonthCal has a <a href="Gui.htm#label">g-label</a>, each launch of it updates the control's <a href="Gui.htm#var">associated output variable</a> (if any) with the currently selected date or range. By default, the label is launched only when: 1) the user changes the selection; or 2) every two minutes in case a new day has arrived (this behavior is a quirk of the OS). However, if the word AltSubmit is in the control's <em>Options</em>, the <a href="Gui.htm#label">g-label</a> is launched more often and the built-in variable A_GuiEvent will contain the word Normal for a change of the date, the number 1 for a click of a date, and the number 2 when the MonthCal releases &quot;mouse capture&quot;. For example, if the user double-clicks a new date, the label would be launched five times: Once with Normal, twice with 1, and twice with 2. This can be used to detect double clicks by <a href="../Variables.htm#TickCount">measuring the time</a> between instances of the number 1.</p>
<p>When specifying dates in the YYYYMMDD format, the MM and/or DD portions may be omitted, in which case they are assumed to be 1. For example, <code>200205</code> is seen as 20020501, and <code>2005</code> is seen as 20050101.</p>
<h3>MonthCal Options</h3>
<p><strong><a name="MonthCalMulti"></a>Multi</strong>: Multi-select. Allows the user to shift-click or click-drag to select a range of adjacent dates (the user may still select a single date too). This option may be specified explicitly or put into effect automatically by means of specifying a selection range when the control is created. For example: <code>Gui, Add, MonthCal, vMyCal, 20050101-20050108</code>. Once the control is created, this option cannot be changed.</p>
<p><strong>Range</strong>: Restricts how far back or forward in time the calendar can go. After the word Range, specify the minimum and maximum dates in YYYYMMDD format (with a dash between them). For example, <code>Range20050101-20050615</code> would restrict the selection to the first 5.5 months of 2005. Either the minimum or maximum may be omitted to leave the calendar unrestricted in that direction. For example, <code>Range20010101</code> would prevent a date prior to 2001 from being selected and <code>Range-20091231</code> (leading dash) would prevent a date later than 2009 from being selected. Without the Range option, any date between the years 1601 and 9999 can be selected.</p>
<p><strong>4</strong>: Specify the number 4 in <em>Options</em> to display week numbers (1-52) to the left of each row of days. Week 1 is defined as the first week that contains at least four days.</p>
<p><strong>8</strong>: Specify the number 8 in <em>Options</em> to prevent the circling of today's date within the control.</p>
<p><strong>16</strong>: Specify the number 16 in <em>Options</em> to prevent the display of today's date at the bottom of the control.</p>

<h2 id="Slider">Slider</h2>
<p>Description: A sliding bar that the user can move along a vertical or horizontal track. The standard volume control in the taskbar's tray is an example of a slider. Example:</p>
<pre>Gui, Add, Slider, vMySlider, 50</pre>
<p>Specify the starting position of the slider as the last parameter. If the last parameter  is omitted, the slider starts off at 0 or the number in the allowable range that is closest to 0.</p>
<p>The user may slide the control by the following means: 1) dragging the bar with the mouse; 2) clicking inside the bar's track area with the mouse; 3) turning the mouse wheel while the control has focus; or 4) pressing the following keys while the control has focus: Arrow keys, Page-up, Page-down, Home, and End.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the current numeric position of the slider. The position is also stored in the output variable whenever the control's <a href="Gui.htm#label">g-label</a> is launched.</p>
<p>If the slider has a <a href="Gui.htm#label">g-label</a>, by default it will be launched only when the user has stopped moving the slider (such as by releasing the mouse button after having dragging it). However, if the word AltSubmit is in the control's <em>Options</em>, the g-label is launched for all slider events and the built-in variable A_GuiEvent will contain one of the following digits or strings:</p>
<p>0: The user pressed the Left-arrow or Up-arrow key.<br>
  1: The user pressed the Right-arrow or Down-arrow key.<br>
  2: The user pressed the Page-up key.<br>
  3: The user pressed the Page-down key.<br>
  4: The user moved the slider via the mouse wheel, or finished a drag-and-drop to a new position.<br>
  5: The user is currently dragging the slider via the mouse; that is, the mouse button is currently down.<br>
  6: The user pressed the Home key to send the slider to the left or top side. <br>
  7: The user pressed the End key to send the slider to the right or bottom side. <br>
  Normal: The user has finished moving the slider, either via the mouse or the keyboard. <u>Note</u>: With the exception of mouse wheel movement (#4), the <a href="Gui.htm#label">g-label</a> is launched again for the &quot;normal&quot; event even though it was already launched for one of the digit-events above.</p>
<h3>Slider Options</h3>
<p><strong>Buddy1</strong> and <strong>Buddy2</strong>: Specifies up to two existing controls to automatically reposition at the ends of the slider. Buddy1 is displayed at the left or top side (depending on whether the Vertical option is present). Buddy2 is displayed at the right or bottom side. After the word Buddy1 or Buddy2, specify the <a href="Gui.htm#var">variable name</a> of an existing control. For example, Buddy1MyTopText would assign the control whose variable name is MyTopText.</p>
<p><strong>Center</strong>: The thumb (the bar moved by the user) will be blunt on both ends rather than pointed at one end.</p>
<p><strong>Invert</strong>: Reverses the control so that the lower value is considered to be on the right/bottom rather than the left/top. This is typically used to make a vertical slider move in the direction of a traditional volume control. Note: The ToolTip option described below will not obey the inversion and therefore should not be used in this case.</p>
<p><strong>Left</strong>: The thumb (the bar moved by the user) will point to the top rather than the bottom. But if the Vertical option is in effect, the thumb will point to the left rather than the right.</p>
<p><strong>Line</strong>: Specifies the number of positions to move when the user presses one of the arrow keys. After the word Line, specify number of positions to move. For example: <code>Line2</code>.</p>
<p><strong>NoTicks</strong>: Omits tickmarks alongside the track.</p>
<p><strong>Page</strong>: Specifies the number of positions to move when the user presses the Page-up or Page-down key. After the word Page, specify number of positions to move. For example: <code>Page10</code>.</p>
<p><strong>Range</strong>: Sets the range to be something other than 0 to 100. After the word Range, specify the minimum, a dash, and maximum. For example, <code>Range1-1000</code> would allow a number between 1 and 1000 to be selected; <code>Range-50-50</code> would allow a number between -50 and 50; and <code>Range-10--5</code> would allow a number between -10 and -5.</p>
<p><strong>Thick</strong>: Specifies the length of the thumb (the bar moved by the user). After the word Thick, specify the thickness in pixels (e.g. <code>Thick30</code>). To go beyond a certain thickness on Windows XP or later, it is probably necessary to either specify the Center option or remove the theme from the control (which can be done by specifying <code>-Theme</code> in the control's options).</p>
<p><strong>TickInterval</strong>: Provides tickmarks alongside the track at the specified interval. After the word TickInterval, specify the interval at which to display additional tickmarks (if the interval is omitted, it is assumed to be 1). For example, <code>TickInterval10</code> would display a tickmark once every 10 positions.</p>
<p><strong>ToolTip</strong>: Creates a tooltip that reports the numeric position of the slider as the user is dragging it. To have the tooltip appear in a non-default position, specify one of the following instead: <code>ToolTipLeft</code> or <code>ToolTipRight</code> (for vertical sliders); <code>ToolTipTop</code> or <code>ToolTipBottom</code> (for horizontal sliders).</p>
<p><strong>Vertical</strong>: Makes the control slide up and down rather than left and right.</p>
<p>The above options can be changed after the control is created via <a href="GuiControl.htm">GuiControl</a>.</p>

<h2 id="Progress">Progress</h2>
<p>Description: A dual-color bar typically used to indicate how much progress has been made toward the completion of an operation. Example:</p>
<pre>Gui, Add, Progress, w300 h20 cBlue vMyProgress</pre>
<p>Specify the starting position of the bar as the last parameter (if omitted, the bar starts off at 0 or the number in the allowable range that is closest to 0). To later change the position of the bar, follow these examples, all of which operate upon a progress bar whose <a href="Gui.htm#var">associated variable name</a> is MyProgress:</p>
<pre><a href="GuiControl.htm">GuiControl</a>,, MyProgress, +20  <em>; Increase the current position by 20.</em>
<a href="GuiControl.htm">GuiControl</a>,, MyProgress, 50  <em>; Set the current position to 50.</em></pre>
<p>For horizontal Progress Bars, the thickness of the bar is equal to the control's height. For vertical Progress Bars it is equal to the control's width.</p>
<h3>Progress Options</h3>
<p><strong>Cn</strong>: Changes the bar's color. Specify for <strong>n</strong> one of the 16 primary HTML <a href="Progress.htm#colors">color names</a> or a 6-digit RGB color value. Examples: <code>cRed</code>, <code>cFFFF33</code>, <code>cDefault</code>. If the C option is never used (or <code>cDefault</code> is specified), the system's default bar color will be used.</p>
<p><strong>BackgroundN</strong>: Changes the bar's background color. Specify for <strong>n</strong> one of the 16 primary HTML <a href="Progress.htm#colors">color names</a> or a 6-digit RGB color value. Examples: <code>BackgroundGreen</code>, <code>BackgroundFFFF33</code>, <code>BackgroundDefault</code>. If the Background option is never used (or <code>BackgroundDefault</code> is specified), the background color will be that of the window or <a href="#Tab">tab control</a> behind it.</p>
<p><strong>Range</strong>: Sets the range to be something other than 0 to 100. After the word Range, specify the minimum, a dash, and maximum. For example, <code>Range0-1000</code> would allow a numbers between 0 and 1000; <code>Range-50-50</code> would allow numbers between -50 and 50; and <code>Range-10--5</code> would allow numbers between -10 and -5.</p>
<p><strong>-Smooth</strong> (minus Smooth): Displays a length of segments rather than a smooth continuous bar. Specifying <code>-Smooth</code> is also one of the requirements to show a themed progress bar on Windows XP or later. The other requirement is that the bar not have any custom colors; that is, that the C and Background options be omitted.</p>
<p><strong>Vertical</strong>: Makes the bar rise or fall vertically rather than move along horizontally.</p>
<p>The above options can be changed after the control is created via <a href="GuiControl.htm">GuiControl</a>.</p>

<h2 id="GroupBox">GroupBox</h2>
<p>Description: A rectangular border/frame, often used around other controls to indicate they are related. In this case, the last parameter is the title of the box, which if present is displayed at its upper-left edge. Example:</p>
<pre>Gui, Add, GroupBox, w400 h300, Geographic Criteria</pre>
<p>By default, a GroupBox's title may have only one line of text. This can be overridden by specifying <code>Wrap</code> in Options.</p>
<p>To specify the number of rows inside the control (or its height and width), see <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<h2 id="Tab"><a name="Tab2"></a>Tab2</h2>
<p>Description: A large control containing multiple pages, each of which contains other controls. From this point forward, these pages are referred to as &quot;tabs&quot;.</p>
<p><strong>Tab2 vs. Tab</strong>: v1.0.47.05 adds the &quot;Tab2&quot; control that fixes rare redrawing problems in the original &quot;Tab&quot; control (e.g. activating a GUI window by clicking certain parts of its controls, such as scrollbars, might redraw improperly). The original Tab control is retained for backward compatibility because Tab2 puts its tab control after its contained controls in the tab-key navigation order. New scripts should use Tab2 whenever possible. Example:</p>
<pre>Gui, Add, Tab2,, General|View|Appearance|Settings</pre>
<p><a name="ChooseTab"></a>The last parameter above is a pipe-delimited list of tab names. To have one of the tabs pre-selected when the window first appears, include two pipe characters after it (e.g. <code>Red|Green||Blue</code>). Alternatively, include in <em>Options</em> the word <strong>Choose</strong> followed immediately by the number to pre-select. For example, <code>Choose5</code> would pre-select the fifth tab (as with other options, it can also be a variable such as <code>Choose%Var%</code>). To change the selected tab, add tabs, or remove tabs after the control has been created, use <a href="GuiControl.htm">GuiControl</a>.</p>
<p><a name="TabCmd"></a>After creating a Tab control, subsequently added controls automatically belong to its first tab. This can be changed at any time by following these examples:</p>
<pre>Gui, Tab  <em>; Future controls are not part of any tab control.</em>
Gui, Tab, 3  <em>; Future controls are owned by the third tab of the current tab control.</em>
Gui, Tab, 3, 2  <em>; Future controls are owned by the third tab of the second tab control.</em>
Gui, Tab, Name  <em>; Future controls are owned by the tab whose name starts with <i>Name</i> (not case sensitive).</em>
Gui, Tab, Name,, Exact  <em>; Same as above but requires exact match (case sensitive too).</em></pre>
<p>It is also possible to use any of the examples above to assign controls to a tab or tab-control that does not yet exist (except in the case of the <em>Name</em> method). But in that case, the relative positioning options described below are not supported.</p>
<p>Positioning: When each tab of a Tab control receives its first sub-control, that sub-control will have a special default position under the following conditions: 1) The X and Y coordinates are both omitted, in which case the first sub-control is positioned at the upper-left corner of the tab control's interior (with a standard <a href="Gui.htm#Margin">margin</a>), and sub-controls beyond the first are positioned beneath the previous control; 2) The <a href="Gui.htm#PosPlus">X+n and/or Y+n</a> positioning options are specified, in which case the sub-control is positioned relative to the upper-left corner of the tab control's interior. For example, specifying <code>x+10 y+10</code> would position the control 10 pixels right and 10 pixels down from the upper left corner.</p>
<p>Sub-controls do not necessarily need to exist within their Tab control's boundaries: they will still be hidden and shown whenever their tab is selected or de-selected. This behavior is especially appropriate for the &quot;buttons&quot; style described below.</p>
<p>When the <a href="Gui.htm#Submit">Gui Submit</a> command is used, the control's <a href="Gui.htm#var">associated output variable</a> (if any) receives the name of the currently selected tab. However, if the control has the <a href="Gui.htm#AltSubmit">AltSubmit</a> property, the output variable will receive the tab's position number instead (the first tab is 1, the second is 2, etc.).</p>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user changes to a new tab. If the tab control has both a <a href="Gui.htm#label">g-label</a> and an <a href="Gui.htm#var">output variable</a>, whenever the user switches to a new tab, the output variable will be set to the previously selected tab name (or number in the case of <a href="Gui.htm#AltSubmit">AltSubmit</a>).</p>
<p>Keyboard navigation: The user may press Control-PageDown/PageUp to navigate from page to page in a tab control; if the keyboard focus is on a control that does not belong to a Tab control, the window's first Tab control will be navigated. Control-Tab and Control-Shift-Tab may also be used except that they will not work if the currently focused control is a multi-line Edit control.</p>
<p>Each window may have no more than 255 tab controls. Each tab control may have no more than 256 tabs (pages). In addition, a tab control may not contain other tab controls.</p>
<h3>Tab Options</h3>
<p><strong>Choose</strong>: See <a href="#ChooseTab">above</a>.</p>
<p><strong>-Background</strong> (minus followed by the word background): Overrides the <a href="Gui.htm#Color">window's custom background color</a> and uses the system's default Tab control color. Specify <code>+Theme -Background</code> to make the Tab control conform to the current desktop theme. However, most control types will look strange inside such a Tab control because their backgrounds will not match that of the tab control. This can be fixed for some control types (such as <a href="#Text">Text</a>) by adding BackgroundTrans to their options.</p>
<p><strong>Buttons</strong>: Creates a series of buttons at the top of the control rather than a series of tabs (in this case, there will be no border by default because the display area does not typically contain controls).</p>
<p><strong>Left/Right/Bottom</strong>: Specify one of these words to have the tabs on the left, right, or bottom side instead of the top. See <a href="../misc/Styles.htm#tcs_vertical">TCS_VERTICAL</a> for limitations on Left and Right.</p>
<p><strong>-Wrap</strong>: Prevents the tabs from taking up more than a single row (in which case if there are too many tabs to fit, arrow buttons are displayed to allow the user to slide more tabs into view).</p>
<p>To specify the number of rows of text inside the control (or its height and width), see <a href="Gui.htm#PosSize">position and sizing of controls</a>.</p>
<p><strong>Icons in Tabs</strong>: An icon may be displayed next to each tab's name/text via <a href="PostMessage.htm">SendMessage</a>. This is demonstrated in the forum topic <a href="http://www.autohotkey.com/forum/topic6060.html">Icons in tabs</a>.</p>
<h2 id="StatusBar">StatusBar<span class="ver">[v1.0.44+]</span></h2>
<p>Description: A row of text and/or icons attached to the bottom of a window, which is typically used to report changing conditions. Example:</p>
<pre>Gui, Add, StatusBar,, Bar's starting text (omit to start off empty).
SB_SetText(&quot;There are &quot; . RowCount . &quot; rows selected.&quot;)</pre>
<p>The simplest use of a status bar is to call <a href="#SB_SetText">SB_SetText()</a> whenever something changes that should be reported to the user. To report more than one piece of information, divide the bar into sections via <a href="#SB_SetParts">SB_SetParts()</a>. To display icon(s) in the bar, call <a href="#SB_SetIcon">SB_SetIcon()</a>.</p>
<p>All of the following StatusBar functions operate upon the current thread's <a href="Gui.htm#DefaultWin">default GUI window</a> (which can be changed via <a href="Gui.htm#Default"><code>Gui, 2:Default</code></a>). If the default window does not exist or has no status bar, all SB functions return 0 to indicate the problem.</p>
<h3><a name="SB_SetText"></a>SB_SetText(NewText [, PartNumber, Style])</h3>
<p>Displays <em>NewText</em> in the specified part of the status bar. If <em>PartNumber</em> is omitted, it defaults to 1. Otherwise, specify an integer between 1 and 256. If <em>Style</em> is omitted, it defaults to 0, which uses a traditional border that makes that part of the bar look sunken. Otherwise, specify 1 to have no border or 2 to have border that makes that part of the bar look raised. Finally, up to two tab characters (`t) may be present anywhere in <em>NewText</em>: anything to the right of the first tab is centered within the part, and anything to the right of the second tab is right-justified. SB_SetText() returns 1 upon success and 0 upon failure.</p>
<h3><a name="SB_SetParts"></a>SB_SetParts([Width1, Width2, ... Width255])</h3>
<p>Divides the bar into multiple sections according to the specified widths (in pixels). If all parameters are omitted, the bar is restored to having only a single, long part. Otherwise, specify the width of each part except the last (the last will fill the remaining width of the bar). For example, <code>SB_SetParts(50, 50)</code> would create three parts: the first two of width 50 and the last one of all the remaining width. Note: Any parts &quot;deleted&quot; by SB_SetParts() will start off with no text the next time they are shown (furthermore, their icons are automatically destroyed). Upon success, SB_SetParts() returns a non-zero value (the status bar's <a href="ControlGet.htm#Hwnd">HWND</a>). Upon failure it returns 0.</p>
<h3><a name="SB_SetIcon"></a>SB_SetIcon(Filename [, IconNumber, PartNumber])</h3>
<p>Displays a small icon to the left of the text in the specified part (if <em>PartNumber</em> is omitted, it defaults to 1). <em>Filename</em> is the name of an icon (.ICO), cursor (.CUR), or animated cursor (.ANI) file (animated cursors will not actually be animated in the bar). Other sources of icons include the following types of files: EXE, DLL, CPL, SCR, and other types that contain icon resources. To use an icon group other than the first one in the file, specify its number for <em>IconNumber</em>. For example, <code>SB_SetIcon(&quot;Shell32.dll&quot;, 2)</code> would use the default icon from the second icon group. If <em>IconNumber</em> is negative, its absolute value is assumed to be the resource ID of an icon within an executable file. SB_SetIcon() returns the icon's HICON upon success and 0 upon failure. The HICON is a system resource that can be safely ignored by most scripts because it is destroyed automatically when the status bar's window is destroyed. Similarly, any old icon is destroyed when SB_SetIcon() replaces it with a new one. This can be avoided via:</p>
<pre>Gui +LastFound
<a href="PostMessage.htm">SendMessage</a>, 0x40F, part_number - 1, my_hIcon, msctls_statusbar321  <em>; 0x40F is SB_SETICON.</em></pre>
<h3><a name="SB_SetProgress"></a>SB_SetProgress()</h3>
<p>Creates and controls a progress bar inside the status bar. This function is available at <a href="http://www.autohotkey.com/forum/topic37754.html">www.autohotkey.com/forum/topic37754.html</a></p>
<h3>G-Label Notifications</h3>
<p>A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options. This would cause the <em>MySubroutine</em> label to be launched automatically whenever the user clicks on the bar. This subroutine may consult the built-in variables <a href="../Variables.htm#Gui">A_Gui</a> and <a href="../Variables.htm#GuiControl">A_GuiControl</a>. More importantly, it may consult <strong>A_GuiEvent</strong>, which contains one of the following strings (for compatibility with future versions, a script should not assume these are the only possible values):</p>
<ul>
  <li><strong>Normal</strong>: The user left-clicked the bar. The variable A_EventInfo contains the part number (however, the part number might be a very large integer if the user clicks near the sizing grip at the right side of the bar).</li>
  <li><strong>RightClick</strong>: The user right-clicked the bar. The variable A_EventInfo contains the part number. NOTE: <a href="Gui.htm#GuiContextMenu">GuiContextMenu</a> will not be called for the status bar if it has a g-label. Also, the g-label's RightClick event should be used instead of <a href="Gui.htm#GuiContextMenu">GuiContextMenu</a> when the script needs to know which part number the user clicked on (A_EventInfo).</li>
  <li><strong>DoubleClick</strong>: The user double-clicked the bar. The variable A_EventInfo contains the part number.</li>
  <li><strong>R</strong>: The user <em>double-right</em>-clicked the bar.  The variable A_EventInfo contains the part number.</li>
</ul>
<h3>Font and Color</h3>
<p>Although the font size, face, and style can be set via <a href="Gui.htm#Font">Gui Font</a> (just like normal controls), the text color cannot be changed. Also, <a href="Gui.htm#Color">Gui Color</a> is not obeyed; instead, the status bar's background color may be changed by specifying in <em>Options</em> the word <strong>Background</strong> followed immediately by a color name (see <a href="Progress.htm#colors">color chart</a>) or RGB value (the 0x prefix is optional). Examples: <code>BackgroundSilver</code>, <code>BackgroundFFDD99</code>, <code>BackgroundDefault</code>.</p>
<h3>Hiding the StatusBar</h3>
<p>Upon creation, the bar can be hidden via <code>Gui, Add, StatusBar, Hidden vMyStatusBar</code>. To hide it sometime after creation, use <code>GuiControl, Hide, MyStatusBar</code>. To show it, use <code>GuiControl, Show, MyStatusBar</code>. Note: Hiding the bar does not reduce the height of the window. If that is desired, one easy way is <code><a href="Gui.htm#AutoSize">Gui, Show, AutoSize</a></code>.</p>
<h3>Styles (rarely used)</h3>
<p>See the <a href="../misc/Styles.htm#StatusBar">StatusBar styles table</a>.</p>
<h3>Known Limitations</h3>
<p>1) Any control that overlaps the status bar might sometimes get drawn on top of it.  One way to avoid this is to dynamically shrink such controls via the <a href="Gui.htm#GuiSize">GuiSize label</a>. 2) There is a limit of one status bar per window.</p>
<h3><strong>Example</strong></h3>
<p>The bottom of the <a href="TreeView.htm#Examples">TreeView page</a> demonstrates a multipart status bar.</p>
<h2 id="ActiveX"><a name="IE_Control"></a>ActiveX <span class="ver">[v1.1.03+]</span></h2>
<p>ActiveX components such as the MSIE browser control can be embedded into a GUI window by following this example:</p>
<pre>Gui Add, ActiveX, w980 h640 vWB, <a href="http://msdn.microsoft.com/en-us/library/aa752085">Shell.Explorer</a>  <em>; The final parameter is the name of the ActiveX component.</em>
WB.<a href="http://msdn.microsoft.com/en-us/library/aa752093">Navigate</a>("http://ahkscript.org/boards/")  <em>; This is specific to the web browser control.</em>
Gui Show</pre>
<p>When the control is created, an ActiveX object is stored in the control's associated variable, if it has one. <a href="GuiControlGet.htm">GuiControlGet</a> can also be used to retrieve the object.</p>
<p>To handle events exposed by the object, use <a href="ComObjConnect.htm">ComObjConnect</a> as demonstrated below:</p>
<pre>Gui Add, Edit, w930 r1 vURL, http://ahkscript.org/boards/
Gui Add, Button, x+6 yp w44 Default, Go
Gui Add, ActiveX, xm w980 h640 vWB, Shell.Explorer
<strong>ComObjConnect</strong>(WB, WB_events)  <em>; Connect WB's events to the WB_events class object.</em>
Gui Show
<em>; Continue on to load the initial page:</em>
ButtonGo:
Gui Submit, NoHide
WB.Navigate(URL)
return

class WB_events
{
    <a href="http://msdn.microsoft.com/en-us/library/aa768334">NavigateComplete2</a>(wb, NewURL)
    {
        GuiControl,, URL, %NewURL%  <em>; Update the URL edit control.</em>
    }
}

GuiClose:
ExitApp</pre>
<p><a href="ComObjType.htm">ComObjType</a> can be used to determine the type of object stored in the control's variable.</p>

<h2 id="Custom">Custom <span class="ver">[v1.1.10+]</span></h2>
<p>Other controls which are not directly supported by AutoHotkey can be also embedded into a GUI window. In order to do so, the Win32 class name must be specified through the <code>Class</code> option in <code>Gui, Add</code>. Examples:</p>
<pre>Gui, Add, Custom, ClassComboBoxEx32  <em>; Adds a <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb775740.aspx">ComboBoxEx</a> control.</em>
Gui, Add, Custom, ClassScintilla  <em>; Adds a <a href="http://scintilla.org/">Scintilla</a> control. Note that the SciLexer.dll library must be loaded before the control can be added.</em></pre>
<p>AutoHotkey uses the standard Windows control text routines when text is to be retrieved/replaced in the control via <code>Gui, Add</code> or <code>GuiControl/Get</code>.</p>
<p><strong>G-Label Notifications</strong>: A <a href="Gui.htm#label">g-label</a> such as <code><strong>g</strong>MySubroutine</code> may be listed in the control's options in order to capture events coming from the control. This subroutine may consult the built-in variables <a href="../Variables.htm#Gui">A_Gui</a> and <a href="../Variables.htm#GuiControl">A_GuiControl</a>. More importantly, it may consult <strong>A_GuiEvent</strong>, which contains one of the following strings (for compatibility with future versions, a script should not assume these are the only possible values):</p>
<ul>
  <li><strong>Normal</strong>: A <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms647591.aspx"><code>WM_COMMAND</code></a> message was received. <code>A_EventInfo</code> contains a control-defined notification code (equivalent to <code>HIWORD(wParam)</code> in C/C++).</li>
  <li><strong>N</strong>: A <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb775583.aspx"><code>WM_NOTIFY</code></a> message was received. <code>A_EventInfo</code> contains a pointer to the control notification structure (<code>NMHDR</code>). A 32-bit signed integer value may be returned to the control by assigning it to <code>ErrorLevel</code> (by default, the g-label thread's <code>ErrorLevel</code> is set to zero). Invalid values are treated as zero.</li>
</ul>
<p>Here is an example that shows how to add and use an <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb761374.aspx">IP address control</a>:</p>
<pre>Gui, Add, Custom, ClassSysIPAddress32 r1 w150 hwndhIPControl gIPControlEvent
Gui, Add, Button, Default, OK
IPCtrlSetAddress(hIPControl, A_IPAddress1)
Gui, Show
return

GuiClose:
ExitApp

ButtonOK:
Gui, Hide
ToolTip
MsgBox % &quot;You chose &quot; IPCtrlGetAddress(hIPControl)
ExitApp

IPControlEvent:
if A_GuiEvent = Normal
{
    <em>; WM_COMMAND was received.</em>

    if (A_EventInfo = 0x0300)  <em>; EN_CHANGE</em>
        ToolTip Control changed!
}
else if A_GuiEvent = N
{
    <em>; WM_NOTIFY was received.

    ; Get the notification code. Normally this field is UInt but the IP address
    ; control uses negative codes, so for convenience we read it as a signed int.</em>
    nmhdr_code := NumGet(A_EventInfo + 2*A_PtrSize, &quot;int&quot;)
    if (nmhdr_code != -860)  <em>; IPN_FIELDCHANGED</em>
        return

    <em>; Extract info from the NMIPADDRESS structure</em>
    iField := NumGet(A_EventInfo + 2*A_PtrSize + 4, &quot;int&quot;)
    iValue := NumGet(A_EventInfo + 2*A_PtrSize + 8, &quot;int&quot;)
    if iValue &gt;= 0
        ToolTip Field #%iField% modified: %iValue%
    else
        ToolTip Field #%iField% left empty
}
return

IPCtrlSetAddress(hControl, ipaddress)
{
    static WM_USER := 0x400
    static IPM_SETADDRESS := WM_USER + 101

    <em>; Pack the IP address into a 32-bit word for use with SendMessage.</em>
    ipaddrword := 0
    Loop, Parse, ipaddress, .
        ipaddrword := (ipaddrword * 256) + A_LoopField
    SendMessage IPM_SETADDRESS, 0, ipaddrword,, ahk_id %hControl%
}

IPCtrlGetAddress(hControl)
{
    static WM_USER := 0x400
    static IPM_GETADDRESS := WM_USER + 102

    VarSetCapacity(addrword, 4)
    SendMessage IPM_GETADDRESS, 0, &amp;addrword,, ahk_id %hControl%
    return NumGet(addrword, 3, &quot;UChar&quot;) &quot;.&quot; NumGet(addrword, 2, &quot;UChar&quot;) &quot;.&quot; NumGet(addrword, 1, &quot;UChar&quot;) &quot;.&quot; NumGet(addrword, 0, &quot;UChar&quot;)
}</pre>

<h2>Related Pages</h2>
<p><a href="ListView.htm">ListView</a>, <a href="TreeView.htm">TreeView</a>, <a href="Gui.htm">Gui</a>, <a href="GuiControl.htm">GuiControl</a>, <a href="GuiControlGet.htm">GuiControlGet</a>, <a href="Menu.htm">Menu</a></p>

</body>
</html>
